package com.sky.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MybatisPlusConfig {
    //使用在方法上,标注将该方法的返回值存储到Spring容器中
    @Bean
    public MybatisPlusInterceptor pageInterceptor(){
        MybatisPlusInterceptor mbpi = new MybatisPlusInterceptor();
        mbpi.addInnerInterceptor(new PaginationInnerInterceptor());
        return mbpi;
    }

}
